#!/bin/sh
rep=http://admin-scripts.googlecode.com/svn/trunk/linux/
dst=/usr/bin/

[ "$1" = "-h" ] || [ "$1" = "--help" ]  && echo "Usage: ${0##*/} {[OPTIONS] [TARGET/] {FILE}} ..." 1>&2  && exit

for f in "$@"; do
   [ -z "$f" ]  && continue

   [ -z "${f##*/}" ]  && [ -d "$f" ]  && dst="$f"  && continue  # if f ends with / and is directory, use it as destination directory

   df="$dst${f##*/}"

   echo -e "\n\nInstalling $df ..."  && wget --no-cache -N "$rep$f" -P "$dst"  && chmod +x "$df"  # only installs newer scripts, replace -N with -nc to always overwrite

   ls -l "$df"
done
